package Test_0813;

import java.util.Comparator;

/**
 * Created with Intellij IDEA
 * Description:
 * User: 星辰
 * Dare: 2024-08-13
 * Time: 20:53
 */
public class NameComparator implements Comparator<Student> {
    @Override
    public int compare(Student o1, Student o2) {
        return o1.name.compareTo(o2.name);//第一个-2094是因为比较的是Student的名字 o1.name - o2.name了
    }
}
